#pragma once
#include <iostream>
#include <stdexcept>
using namespace std;


class unexpected_mean :public logic_error
{
private:
	double v1;
	double v2;
public:
	unexpected_mean(double a=0,double b=0,string s="mean error"):v1(a),v2(b),logic_error(s){}
	virtual void mesg() = 0;
};

inline void unexpected_mean::mesg()
{
	cout << v1 << " " << v2 << endl;
}

class bad_hmean:public unexpected_mean
{
private:
	double v1;
	double v2;
public:
	bad_hmean(double a=0,double b=0,const string what_arg="HMean,Invalid argument") :unexpected_mean(a,b,what_arg) {}
	void mesg();
};
inline void bad_hmean::mesg()
{
	cout << "bad_HMean() now" << endl;
	cout << what() << endl;
	cout << "Hmean invalid arguments\n";
	unexpected_mean::mesg();
}

class bad_gmean:public unexpected_mean
{
public:
	double v1;
	double v2;
	bad_gmean(double a=0,double b=0, const string what_arg = "GMean,Invalid argument") :unexpected_mean(a, b, what_arg) {}
	void mesg();
};
inline void bad_gmean::mesg()
{
	cout << "bad_gmean() now" << endl;
	cout << what() << endl;
	cout << "Gmean invalid arguments\n";
	unexpected_mean::mesg();
}


